package com.neudeu.zy;

public class SalesEmployee extends ColaEmployee{
    //成员变量
    //月销售额
    double monthSaleTotal;
    //提成率
    double saleRate;

    //行为方法

    //此处使用了多态：子类重写了父类的同名方法

    @Override
    public double getSalary(int month) {
        //计算销售人员工资
        double mySalary=monthSaleTotal *saleRate;
        //计算有没有生日金
        mySalary+=super.getSalary(month);
        return mySalary;
    }

    public SalesEmployee() {
    }

    public SalesEmployee(String eName,int eBirthdayMonth, double monthSaleTotal, double saleRate) {
        super(eName,eBirthdayMonth);
        this.monthSaleTotal = monthSaleTotal;
        this.saleRate = saleRate;
    }

    public double getMonthSaleTotal() {
        return monthSaleTotal;
    }

    public void setMonthSaleTotal(double monthSaleTotal) {
        this.monthSaleTotal = monthSaleTotal;
    }

    public double getSaleRate() {
        return saleRate;
    }

    public void setSaleRate(double saleRate) {
        this.saleRate = saleRate;
    }
}
